Get All Knowledges Based on Filters
Used to retrieve a list of knowledge base entries based on specified filter criteria, including pagination, type filtering, search, and status filters.
API Endpoint
| Property | Value |
|---|---|
| Request Method | POST |
| Request URL | https://api.seliseblocks.com/kb/knowledges |
Request
Request Example
curl -X POST 'https://api.seliseblocks.com/kb/knowledges' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"is_disabled": false,
"is_archived": false,
"project_key": "YOUR_PROJECT_KEY",
"limit": 50,
"offset": 0,
"kb_type": "qa",
"search": "password reset",
"agent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"ids": ["kb_001", "kb_002"]
}'
Request Headers
| Field | Type | Required | Description |
|---|---|---|---|
| accept | string | Yes | Accepted response format. Use application/json |
| Content-Type | application/json | Yes | Data type, must be application/json. |
Request Body
Request Body Schema
{
"is_disabled": true,
"is_archived": true,
"project_key": "string",
"limit": 100,
"offset": 0,
"kb_type": "string",
"search": "string",
"agent_id": "string",
"ids": ["string"]
}
Request Body Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| is_disabled | boolean | No | Filter by disabled status. true returns only disabled entries, false returns only active entries. |
| is_archived | boolean | No | Filter by archived status. true returns only archived entries, false returns only non-archived entries. |
| project_key | string | Yes | The project key for your project. |
| limit | integer | No | Maximum number of knowledge entries to return. Default: 100. |
| offset | integer | No | Number of entries to skip for pagination. Default: 0. |
| kb_type | string | No | Filter by knowledge type (e.g., file, text, qa, link). |
| search | string | No | Search term to filter entries by content or metadata. |
| agent_id | string | No | UUID of the AI agent to filter knowledge entries by. |
| ids | array | No | Array of specific knowledge base IDs to retrieve. |
note
All filter parameters are optional except project_key. If no filters are provided, the endpoint returns all knowledge entries within the specified project, subject to pagination limits.
Response
Success Response (200 OK)
Returns an object containing an array of knowledge base entries and the total count.
{
"knowledge_bases": [
{
"kb_id": "kb_001",
"type": "qa",
"question": "How do I reset my password?",
"content": "To reset your password, click on the Forgot Password link on the login page...",
"agent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"is_disabled": false,
"is_archived": false,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:45:00Z",
"metadata": {
"source": "user_submission",
"category": "account_management"
}
},
{
"kb_id": "kb_002",
"type": "text",
"content": "Our platform supports multiple languages including English, German, French, and Spanish...",
"agent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"is_disabled": false,
"is_archived": false,
"created_at": "2024-01-16T11:00:00Z",
"updated_at": "2024-01-16T11:00:00Z",
"metadata": {
"source": "documentation",
"category": "features"
}
},
{
"kb_id": "kb_003",
"type": "file",
"file_name": "product_guide.pdf",
"file_id": "file_123",
"content": "Extracted content from the PDF document...",
"agent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"is_disabled": false,
"is_archived": false,
"created_at": "2024-01-17T09:15:00Z",
"updated_at": "2024-01-17T09:15:00Z",
"metadata": {
"source": "file_upload",
"file_size": 2048576
}
}
],
"total_count": 3
}
Response Fields
| Field | Type | Description |
|---|---|---|
| knowledge_bases | array | Array of knowledge base entry objects matching the filters. |
| total_count | integer | Total number of knowledge entries matching the filters (before pagination). |
Knowledge Base Entry Fields
| Field | Type | Description |
|---|---|---|
| kb_id | string | Unique identifier of the knowledge base entry. |
| type | string | Type of knowledge entry (file, text, qa, link). |
| question | string | Question text (only for Q&A type entries). |
| content | string | Main content or answer text. |
| file_name | string | Name of the file (only for file type entries). |
| file_id | string | Identifier of the file (only for file type entries). |
| agent_id | string | UUID of the associated AI agent. |
| is_disabled | boolean | Whether the entry is currently disabled. |
| is_archived | boolean | Whether the entry is archived. |
| created_at | string | ISO 8601 timestamp of when the entry was created. |
| updated_at | string | ISO 8601 timestamp of the last update. |
| metadata | object | Additional metadata associated with the entry. |
Error Response (422 Unprocessable Entity)
Returns validation error details when the request body is invalid.
{
"detail": [
{
"loc": [
"body",
"limit"
],
"msg": "ensure this value is less than or equal to 1000",
"type": "value_error.number.not_le"
}
]
}
Error Response Fields
| Field | Type | Description |
|---|---|---|
| detail | array | Array of validation error objects. |
| loc | array | Location of the error in the request (e.g., body field). |
| msg | string | Human-readable error message. |
| type | string | Error type identifier. |
Error Codes
| Status Code | Description | Response Type |
|---|---|---|
| 200 | Successful Response | Success |
| 422 | Validation Error - Invalid request parameters | Unprocessable Entity |